<?php

namespace app\validate;

use app\Validate;

class File extends Validate
{
    /**
     * 所有验证场景需要的字段.
     *
     * @var array<array>
     */
    protected $scene = [
        'upload' => ['file'],
        'multi' => ['files'],
        'editor' => ['upload'],
    ];
    /**
     * Get the validation rules that apply to the request.
     *
     * @var array<string>
     */
    protected $rule = [
        'file' => 'fileMime:image/jpeg,image/png,image/gif|fileSize:2048',  // ID
        'files'  => 'array',  // 模块父ID
        'upload' => 'fileMime:image/jpeg,image/png|fileSize:2048',  // ID
    ];
    /**
     * 验证字段描述
     * 
     * @var array<string>
     */
    protected $field = [
        'file' => '上传文件',
        'files' => '上传文件',
        'upload' => '上传文件',
    ];
}
